package donjuan;

import java.awt.FlowLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class PrepareFrame extends JFrame {//该窗口用于呈现登录时使用
  ArrayList<Readin> cha = null;
  
  Statement sql = null;
  
  Window_main junk;
  
  PrepareFrame() 
  {
    this.junk = new Window_main(this.cha, this.sql);
    setVisible(false);
    setBounds(10, 10, 500, 500);
    setDefaultCloseOperation(3);
    setLayout(new FlowLayout());
    setTitle("个人信息管理界面");
    addWindowListener(new Close_WindowListener());
    getContentPane().add(Window_main.p1);
    greet_user();
  } 
  private void greet_user() 
  {
	  Confirm con=new Confirm();	  
  }
  class Close_WindowListener extends WindowAdapter {//当用户退出窗口时关闭数据库链接
    public void windowClosing(WindowEvent e) {
      super.windowClosing(e);
      if (Message.con != null)
        try {
          Message.con.close();
        } catch (SQLException e1) {
          System.exit(-1);
        }  
      System.exit(0);
    }
  }
  
}
